(function (mui, window) {
    var v3AceOasisAlarm = window.v3AceOasisAlarm = {};
    var baseRequest = window.baseRequest;
    var appConfig = window.appConfig;
    var commonTool = window.commonTool;
    var dataManager = window.dataManager;
    var locale = dataManager.getLocale();
	var baseUrl = appConfig.v3ServiceUrl + '/ace/oasis/oasis-alarm';
    //add by dongyi
	var getOasisAlarmUrl = baseUrl + '/sendmsg/sendmsglistbypage';
	//获取认证模板列表接口
	v3AceOasisAlarm.getOasisAlarmList = function (userName, starTime, endTime, pageSize, callback) {
        baseRequest.commonPost(getOasisAlarmUrl, {
    			userName: userName,
    			startTime: starTime,
    			endTime: endTime,
    			pageSize: pageSize
    		}, 10000, function(code, data){
    			if(code === 0){
				if(data == -1 || data.errmsg == 'fail') {
					callback(1);
				} else {
					callback(0, data.data);
				}
			}
			if(code === 1 || code ===2){
				return callback(2);
			}
    	})
    }
	
	//获取场所列表接口
	var getAllShopsUrl = baseUrl + '/subscribe/getallshops?';
	v3AceOasisAlarm.getAllShops = function (userName, callback) {
        baseRequest.commonGet(getAllShopsUrl + mui.param({userName:userName}), 10000, function (code, data) {
            if (code === 2 || code === 1) {
                return callback(2);
            }
            if (code === 0) {
                callback(0, data.data);
            }
        });
    }
    //  end
    //add by ding
    //end
    //add by zhangfuqiang
    // end
    
    // by wangyu
    //end
}(mui, window));